<?php

/**
 * Albireo Kernel
 *
 * @copyright  Copyright (c) 2010 Albireo Solutions
 * @package    Kernel
 */

namespace KernelModule\UsersModule;

use Albireo\MenuGenerator;
use KernelModule\BasePresenter;

/**
 * Users Overview presenter.
 *
 * @author     Albireo Solutions
 * @package    Kernel
 */
class OverviewPresenter extends BasePresenter {

    public function renderDefault() {
        if(!isset($this->template->title))$this->template->title = _("User Management");
        $this->showMenu();
        $this->showUsersMenu();
    }

    protected function showUsersMenu() {
        $aclImPrefix = "images/kernel/users/";

        $items = array(
            "Kernel:Users:Users" => array("icon" => $aclImPrefix."users.jpg", "title" => _("Users")),
            'Kernel:Users:Roles' => array("icon" => $aclImPrefix."roles.jpg", "title" => _("Roles"))
        );
        $menuGenerator = new MenuGenerator();
        $menu = $menuGenerator->universalMenu($this->getUser(), $items);

        $this->template->usersMenu = $menu;

    }

}